import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dk_form/flutter_dk_form.dart';

class PageTimeAxisWidget extends StatelessWidget{

  static const String routeName = '/page/time_axis_demo_page';
  static const String name = "TimeAxis Demo";

  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(title: Text("TimeAxis Demo")),
      body: Column(children: <Widget>[
        Text("时间轴垂直"),
        SingleChildScrollView(
          child: Column(
            children: <Widget>[
              TimeAxisVerticalWidget(
                  _list(),
                  itemClick: _onItemClick),
//              TimeAxisVertical1Widget(
//                  _list(),
//                  itemClick: _onItemClick),
            ],
          ),
        ),
      ],),
    );
  }

}

_onItemClick(int position) {
  print("_onItemClick=" + position.toString());
}

List _list(){
  List data = List();
  data.add(VerticalTimeAxisItem(
      firstTitle: "电话沟通",
      secondTitle: "zm",
      time: DateTime.now().toString(),
      describe: "测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据"
  ));
  data.add(VerticalTimeAxisItem(
      firstTitle: "微信沟通",
      secondTitle: "hh",
      time: DateTime.now().toString(),
      describe: "测试数据测试数据"
  ));
  data.add(VerticalTimeAxisItem(
      firstTitle: "电话沟通",
      secondTitle: "oo",
      time: DateTime.now().toString(),
      describe: "测试数据测试数据测试数据测试数据测试数据测试数"));
  data.add(VerticalTimeAxisItem(
      firstTitle: "电话沟通",
      secondTitle: "aa",
      time: DateTime.now().toString(),
      describe:
      "测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据"));
  return data;
}

//class StepWidget extends StatelessWidget {
//  @override
//  Widget build(BuildContext context) {
//
//    return SingleChildScrollView(
//      child: TimeAxisVerticalWidget(
//          _list(),
//          itemClick: _onItemClick),
//    );
//  }
//
//
//}